package com.tcl.aota.admin.dto;

import org.apache.commons.lang.StringUtils;

/**
 * SoapMessage解析对象
 *
 * @author kelong
 * @date 5/12/15
 */
public class CurefObj {
    private Long id;//id
    private String product;//productFamily
    private String curefRegexp;//curef集合
    private String curef;//具体CU
    private String userName;//user_name

    public CurefObj(Long id, String product, String curefRegexp, String curef, String userName) {
        this.id = id;
        this.product = product;
        this.curefRegexp = curefRegexp;
        this.curef = curef;
        this.userName = userName;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getProduct() {
        return product;
    }

    public void setProduct(String product) {
        this.product = product;
    }

    public String getCurefRegexp() {
        return curefRegexp;
    }

    public void setCurefRegexp(String curefRegexp) {
        this.curefRegexp = curefRegexp;
    }

    public String getCuref() {
        return curef;
    }

    public void setCuref(String curef) {
        this.curef = curef;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }


    /**
     * check data
     *
     * @return
     */
    public boolean isVaild() {
        if (id == null || id == 0) {
            return false;
        }
        if (StringUtils.isEmpty(product)) {
            return false;
        }
        if (StringUtils.isEmpty(curefRegexp)) {
            return false;
        }
        if (StringUtils.isEmpty(curef)) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "CurefObj{" +
            "id=" + id +
            ", product='" + product + '\'' +
            ", curefRegexp='" + curefRegexp + '\'' +
            ", curef='" + curef + '\'' +
            ", userName='" + userName + '\'' +
            '}';
    }
}
